package com.uidt.project.ptsj.service.impl;

import java.util.List;
import com.uidt.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.uidt.project.ptsj.mapper.ProblemMapper;
import com.uidt.project.ptsj.domain.Problem;
import com.uidt.project.ptsj.service.IProblemService;

/**
 * 巡检问题记录Service业务层处理
 * 
 * @author uidt
 * @date 2024-08-12
 */
@Service
public class ProblemServiceImpl implements IProblemService 
{
    @Autowired
    private ProblemMapper ptsjProblemMapper;

    /**
     * 查询巡检问题记录
     * 
     * @param id 巡检问题记录主键
     * @return 巡检问题记录
     */
    @Override
    public Problem selectProblemById(Long id)
    {
        return ptsjProblemMapper.selectProblemById(id);
    }

    /**
     * 查询巡检问题记录列表
     * 
     * @param ptsjProblem 巡检问题记录
     * @return 巡检问题记录
     */
    @Override
    public List<Problem> selectProblemList(Problem ptsjProblem)
    {
        return ptsjProblemMapper.selectProblemList(ptsjProblem);
    }

    /**
     * 新增巡检问题记录
     * 
     * @param ptsjProblem 巡检问题记录
     * @return 结果
     */
    @Override
    public int insertProblem(Problem ptsjProblem)
    {
        return ptsjProblemMapper.insertProblem(ptsjProblem);
    }

    /**
     * 修改巡检问题记录
     * 
     * @param ptsjProblem 巡检问题记录
     * @return 结果
     */
    @Override
    public int updateProblem(Problem ptsjProblem)
    {
        ptsjProblem.setUpdateTime(DateUtils.getNowDate());
        return ptsjProblemMapper.updateProblem(ptsjProblem);
    }

    /**
     * 批量删除巡检问题记录
     * 
     * @param ids 需要删除的巡检问题记录主键
     * @return 结果
     */
    @Override
    public int deleteProblemByIds(Long[] ids)
    {
        return ptsjProblemMapper.deleteProblemByIds(ids);
    }

    /**
     * 删除巡检问题记录信息
     * 
     * @param id 巡检问题记录主键
     * @return 结果
     */
    @Override
    public int deleteProblemById(Long id)
    {
        return ptsjProblemMapper.deleteProblemById(id);
    }
}
